<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="shortcut icon" href="<c:url value="/resources/favicon.ico" />" />
<link rel="icon" type="image/gif" href="<c:url value="/resources/animated_favicon.gif" />" />
<link href="<c:url value="/resources/css/login.css" />" rel="stylesheet" type="text/css" />
<!--[if IE]>
<script src="<c:url value="/resources/js/jquery-1.6.4.min.js" />" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
	$(document).ready(function(){
		$("#txtPassword").attr('size','31');
	});
</script>
<![endif]-->
<!--[if lte IE 8]>
<script src="<c:url value='/resources/js/DD_roundies_0.0.2a.js' />" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
	DD_roundies.addRule('.cabeceraLogin', '8px 8px 0px 0px');
	DD_roundies.addRule('.cuerpoLogin','0px 0px 8px 8px');
	DD_roundies.addRule('.cuerpoLogin form input','3px');
	DD_roundies.addRule('.btn-login','6px');
	DD_roundies.addRule('.mensaje-error','5px');	
</script>
<![endif]-->
<script language="javascript" type="text/javascript">
	function login(event,formulario) {
		if (event && event.which == 13)
			formulario.submit();
		else
			return true;
	}	
</script>
<title>::Consolidador de Ventas::</title>
</head>
<body>
	<c:choose>
		<c:when test="${sessionScope.usuarioSistema==null}">
			<div class="formularioLogin">
				<div class="cabeceraLogin">
					<div class="logoEmpresa">
						<img src="<c:url value="/resources/img/gazel.png" />" width="70" height="55" alt="" title="" />
					</div>
					<div class="tituloFormulario">Consolidador de Ventas</div>
				</div>
				<div class="cuerpoLogin">
					<form:form id="formLogin" action="iniciarSesion.php" method="post">
						<table>
							<tr>
								<td align="right"><label class="etiqueta">Usuario : </label></td>
								<td><input type="text" name="usuario" size="30" onkeypress="return login(event,this.form)" /></td>
							</tr>
							<tr>
								<td align="right"><label class="etiqueta">Clave : </label></td>
								<td><input id="txtPassword" type="password" name="clave" size="30" onkeypress="return login(event,this.form)" /></td>
							</tr>
							<tr>
								<td>&nbsp;</td>
								<td align="right">
								<div style="height:4px"></div>
								<a class="btn-login" href="javascript:document.forms['formLogin'].submit();">Ingresar</a>
								</td>
							</tr>
						</table>
					</form:form>
					<c:if test="${mensajeError!=null}">
							<div class="mensaje-error">
								<div class="texto-error"><c:out value="${mensajeError}" /></div>
							</div>
					</c:if>	
				</div>
			</div>
		</c:when>
		<c:otherwise>
			 <script language="javascript">window.location.href="consultaEnvios.php";</script>
		</c:otherwise>
	</c:choose>
</body>
</html>